<!--重要区域-->
<link rel="stylesheet" href="<?php echo SHOP_TEMPLATES_URL;?>/css/new/discounts.css">
<script type="text/javascript" src="<?php echo SHOP_TEMPLATES_URL;?>/js/new/discounts.js"></script>
<?php echo $output['web_html']['new_indexp'];?>

<div class="main">
    <div class="main_ct">
        <div class="left">
            <!--限时优惠-->
            <?php if(!empty($output['xianshi_item'])||!empty($output['xianshi_item2'])){ ?>
            <div class="time" id="xianshi">
                <div class="title">
                    <div class="test">
                        限时特惠 <span>/本商城所有优惠只能在小程序上购买哦！</span>
                    </div>
                    <div class="optionList">
                        <ul>
                            <li class="active">
                                正在进行
                            </li>
                            <li>
                                即将开始 <span>明天09:00</span>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="list_box" style="display: <?php if(!empty($output['xianshi_item'])){echo 'block';}else{echo 'none';} ?>;">
                    <?php if(!empty($output['xianshi_item'])){ ?>
                    <ul>
                        <!--列表-->
                        <?php foreach($output['xianshi_item'] as $v){ ?>
                        <li>
                            <div class="img">
                                <img src="<?php echo $v['image_url'];?>" alt="<?php echo $v['goods_name']; ?>">
                            </div>
                            <div class="test">
                                <?php echo $v['goods_name']; ?>
                            </div>
                            <div class="numsl">
                                <?php $goods_price = explode('.',$v['xianshi_price']);?>
                                ￥<span><?php echo $goods_price[0]; ?></span>.<?php echo $goods_price[1]; ?>
                                <span>￥<?php echo $v['goods_price']; ?></span>
                            </div>
                            <a href="<?php echo urlShop('goods','index',array('goods_id'=> $v['goods_id'])); ?>">
                                <div class="btn">
                                    立即抢购
                                </div>
                            </a>
                        </li>
                        <?php } ?>
                    </ul>
                    <?php }else{ ?>
                        <ul style="height: 460px;">
                            暂无数据
                        </ul>
                    <?php } ?>
                </div>
		            <div class="list_box" style="display:<?php if(empty($output['xianshi_item'])&&!empty($output['xianshi_item2'])){echo 'block';}else{echo 'none';} ?>;">
                        <?php if(!empty($output['xianshi_item2'])){ ?>
			            <ul>
				            <!--列表-->
				            <?php foreach($output['xianshi_item2'] as $v){ ?>
				            <li>
					            <div class="img">
						            <img src="<?php echo $v['image_url'];?>" alt="<?php echo $v['goods_name']; ?>">
					            </div>
					            <div class="test">
						            <?php echo $v['goods_name']; ?>
					            </div>
					            <div class="numsl">
						            <?php $goods_price = explode('.',$v['xianshi_price']);?>
						            ￥<span><?php echo $goods_price[0]; ?></span>.<?php echo $goods_price[1]; ?>
						            <span>￥<?php echo $v['goods_price']; ?></span>
					            </div>
					            <a href="<?php echo urlShop('goods','index',array('goods_id'=> $v['goods_id'])); ?>">
						            <div class="btn">
							            立即抢购
						            </div>
					            </a>
				            </li>
				            <?php } ?>
			            </ul>
                        <?php }else{ ?>
                            <ul style="height: 460px;">
                                暂无数据
                            </ul>
                        <?php } ?>
		            </div>
            </div>
            <?php } ?>
            <!--拼团模块-->
            <?php if(!empty($output['pintuan_list'])){ ?>
            <div class="booking_module" id="pintuan">
                <div class="title">
                    天天火拼 <span>/本商城所有优惠只能在小程序上购买哦！</span>
                </div>
                <div class="list_box">
                    <ul id="pintuanlist">
                        <!--列表-->
                        <?php foreach($output['pintuan_list'] as $v){ ?>
                        <li>
                            <div class="img">
                                <img src="<?php echo $v['goods_image'];?>" alt="<?php echo $v['goods_name'];?>">
                            </div>
                            <div class="rigtest">
                                <div class="t">
                                    <?php echo $v['goods_name'];?>
                                </div>
                                <a href="javascript:;">
                                    <div class="invite">
                                        <div class="d1">邀请好友开团</div>
                                        <div class="d2">立减
                                            <?php echo $v['goods_price']-$v['pintuan_price'];?>
                                            元</div>
                                    </div>
                                </a>
                                <div class="have">
                                    已买<?php echo $v['sale_count'];?>件
                                </div>
                                <div class="sum">
                                    <div class="jg">
                                        <?php $goods_price = explode('.',$v['pintuan_price']);?>
                                        ￥<span><?php echo $goods_price[0]; ?></span>.<?php echo $goods_price[1]; ?>
                                    </div>
                                    <div class="ewm">
                                        <img src="<?php echo $v['qr_code'];?>" alt="扫码二维码在小程序上查看该商品">
                                        <div class="test">
                                            关注小程序
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </li>
                        <?php } ?>
                    </ul>
                </div>
            </div>
            <?php } ?>
            <!--砍价模块-->
            <?php if(!empty($output['kanjia_list'])){ ?>
            <div class="bargain_module" id="kanjia">
                <div class="title">
                    天天砍价团 <span>/本商城所有优惠只能在小程序上购买哦！</span>
                </div>
                <div class="list_box">
                    <ul>
                        <!--列表-->
                        <?php foreach($output['kanjia_list'] as $v){ ?>
                        <li>
                            <div class="img">
                                <img src="<?php echo $v['goods_image'];?>" alt="<?php echo $v['goods_name'];?>">
                            </div>
                            <div class="rigtest">
                                <div class="t">
                                    <?php echo $v['goods_name'];?>
                                </div>
                                <!--倒计时-->
                                <div class="time time-remain" count_down="<?php echo $v['count_down']; ?>">
                                    <div class="d1">距离时间还剩：</div>

                                    <span time_id="h">0</span>
                                    <div class="d2">:</div>
                                    <span time_id="m">0</span>
                                    <div class="d2">:</div>
                                    <span time_id="s">0</span>
                                </div>
                                <!--进度条-->
                                <div class="progress">
                                    <div class="jd" style="width: <?php echo $v['kanjia_percent']; ?>%;"></div>
                                </div>
                                <div class="have">
                                    已砍<span>￥<?php echo ncPriceFormat($v['already_kanjia_price']); ?></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;还剩<span>￥<?php echo ncPriceFormat($v['goods_price']-$v['kanjia_price']-$v['already_kanjia_price']); ?></span>
                                </div>
                                <div class="sum">
                                    <div class="jg">
                                        <?php $goods_price = explode('.',$v['kanjia_price']);?>
                                        ￥<span><?php echo $goods_price[0]; ?></span>.<?php echo $goods_price[1]; ?>
                                    </div>
                                    <div class="ewm">
                                        <img src="<?php echo $v['qr_code'];?>" alt="扫码二维码在小程序上查看该商品">
                                        <div class="test">
                                            关注小程序
                                        </div>
                                    </div>
                                    <div class="invite">
                                        邀请好友砍价
                                    </div>
                                </div>
                            </div>
                        </li>
                        <?php } ?>
                    </ul>
                </div>
            </div>
            <?php } ?>
        </div>
        <div class="right">
            <!--关注小程序-->
            <div class="ui_img">
                <a href="javascript:;">
                    <img src="<?php echo SHOP_TEMPLATES_URL;?>/images/newimages/ui_img5.png" alt="">
                    <img class="applet_qrcode" src="<?php echo UPLOAD_SITE_URL.DS.ATTACH_MOBILE.DS.C('applet_qrcode');?>" alt="">
                </a>
            </div>
            <!--活动列表-->
            <ul class="activityList">
                <a href="#xianshi">
                    <li style="background: #b98b05;">
                        <div class="yuan"></div>
                        限时特惠
                    </li>
                </a>
                <a href="#pintuan">
                    <li style="background: #dba403;">
                        <div class="yuan"></div>
                        天天火拼
                    </li>
                </a>
                <a href="#kanjia">
                    <li style="background: #ffbe00;">
                        <div class="yuan"></div>
                        天天砍价团
                    </li>
                </a>
            </ul>
            <!--分类-->
            <div class="classifyBox">
                <div class="topT">
                    <a href="<?php echo urlShop('category','index'); ?>">所有分类></a>
                </div>
                <div class="search">
                    <form id="category_sear_form" action="<?php echo SHOP_SITE_URL;?>" method="get" >
                        <input name="act" id="search_act" value="category" type="hidden">
                        <input name="op" id="search_op" value="new_index" type="hidden">
                        <input name="cate_id" id="search_op" value="<?php echo $_GET['cate_id']; ?>" type="hidden">
                        <input type="text" name="keyword" placeholder="搜索">
                        <a href="javascript:;">
                            <div class="btn" onclick="$('#category_sear_form').submit()">
                                <img src="<?php echo SHOP_TEMPLATES_URL;?>/images/newimages/searimg1.png" alt="" />
                            </div>
                        </a>
                    </form>
                </div>
                <ul class="list">
                    <?php if(!empty($output['staple_cate'])){ ?>
                        <?php foreach($output['staple_cate'] as $v){ ?>
                    <li>
                        <a href="<?php echo urlShop('category','index',array('cate_id'=>$v['gc_id']));?>"><?php echo $v['gc_name']; ?></a>
                    </li>
                        <?php } ?>
                    <?php } ?>
                </ul>
            </div>
        </div>
    </div>
</div>
<!--<script src="--><?php //echo SHOP_RESOURCE_SITE_URL;?><!--/js/home_index.js" ></script>-->
<script>
    function takeCount() {
        setTimeout("takeCount()", 1000);
        $(".time-remain").each(function(){
            var obj = $(this);
            var tms = obj.attr("count_down");
            if (tms>0) {
                tms = parseInt(tms)-1;
                var hours = Math.floor(tms / (1 * 60 * 60));
                var minutes = Math.floor(tms / (1 * 60)) % 60;
                var seconds = Math.floor(tms / 1) % 60;

                if (hours < 0) hours = 0;
                if (minutes < 0) minutes = 0;
                if (seconds < 0) seconds = 0;
                obj.find("[time_id='h']").html(hours);
                obj.find("[time_id='m']").html(minutes);
                obj.find("[time_id='s']").html(seconds);
                obj.attr("count_down",tms);
            }else{
                obj.parents('li').find('.jd,.invite').css({'background-color':'#ccc'});
                obj.parents('li').find('.jg,.have>span').css({'color':'#ccc'});
            }
        });
    }
    $(function(){
        $('.user_land_box').hide();
        setTimeout("takeCount()", 1000);
    });
</script>